package main

import (
	"begouser/config"
	"begouser/router"
	"fmt"

	"github.com/astaxie/beego"
)

func main() {
	driverName := "mysql"
	dsn := "golang:zxc,./123@tcp(43.139.115.142:3306)/user?charset=utf8mb4&loc=Local&parseTime=true"

	err := config.InitDb(driverName, dsn)
	if err != nil {
		fmt.Println(err)
		return
	}
	defer config.CloseDB()
	router.RegisterRouters()

	// http.ListenAndServe(":19999", nil)
	beego.Run()
}
